home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / lib / sendmail.cf.auto.z / sendmail.cf.auto
Text File  |  1992-04-03  |  31KB  |  992 lines

  1. ############################################################
  2. ############################################################
  3. #####
  4. #####        SENDMAIL CONFIGURATION FILE
  5. #####          AUTOCONFIGURING VERSION
  6. #####
  7. ############################################################
  8. ############################################################
  9. #  Copyright (c) 1983 Regents of the University of California.
  10. #  All rights reserved.  The Berkeley software License Agreement
  11. #  specifies the terms and conditions for redistribution.
  12. #
  13. #
  14. # To install this file:
  15. #
  16. #     1) Review the rules preceded by the "??? unusual rule" comment.
  17. #    2) Rename this file to be /usr/lib/sendmail.cf
  18. #    3) Restart the sendmail daemon by typing:
  19. #        /etc/init.d/mail start
  20. #    4) Wait for the sendmail daemon to configure itself and restart.
  21. #       This process may take a minute or so.
  22. #
  23. # For most configurations, the above steps should be sufficient to provide
  24. # a working sendmail configuration.  It should not be necessary to make
  25. # any further changes to this file in order to adjust the configuration.
  26. # If you want to modify the default configuration, verify the current
  27. # configuration parameter settings, or simply get more information about
  28. # the configuration parameters themselves, use the /usr/etc/configmail
  29. # script.
  30. #
  31. # A quick check and adjustment of the most important configuration parameters
  32. # can be made by issuing the following command: "/usr/etc/configmail setup"
  33. #
  34. # This file and the accompanying /usr/etc/configmail script are provided as
  35. # an example of how to use sendmail's new ability to read macro and class
  36. # definitions from pipes to simplify and automate the sendmail configuration
  37. # process.  Sophisticated sendmail users may wish to expand upon the basic
  38. # scheme presented here.
  39. # The remainder of this file is a nearly identical copy of the "default"
  40. # suggested configuration file.  The only difference is that this file
  41. # reads the values of the following macros and classes from the output of
  42. # the /usr/etc/configmail script, while the "default" configuration file
  43. # must be edited by hand.
  44. #
  45. # Definitions of user configurable macros and classes:
  46. #
  47. #    D macro and class (local (D)omain name)
  48. #        The D macro defines the local domain name.
  49. #        Define this macro to contain the name of the domain in
  50. #        which this host resides.  If no domains are used, you
  51. #        should make sure that this macro is left empty or comment
  52. #        it out.
  53. #
  54. #        The D class explicitly lists all domains to which this
  55. #        host should send mail directly via the ethernet mailer.
  56. #
  57. #        Mail destined for domains not listed in the D class will
  58. #        be sent via an exchanger, or relay host associated
  59. #        with the destination host in preference to sending it
  60. #        directly to the recipient host.
  61. #
  62. #        Mail destined for domains listed in the D class will be
  63. #        sent directly to the destination host if possible.  No
  64. #        attempt will be made to send the mail via an exchanger,
  65. #        or relay host.
  66. #
  67. #        If this host is a relay or exchanger for a particular
  68. #        domain, that domain should appear in the D class.
  69. #
  70. #        If this host is not an exchanger or relay, this class
  71. #        may be left empty.
  72. #
  73. #    F macro and class ((F)orwarder hostname)
  74. #        The F macro defines the name or alias of the host to which
  75. #        this host will send all mail to unknown hosts or domains.
  76. #        It is strongly suggested that the F macro contiain the
  77. #        fully qualified domain name (FQDN) of the forwarder host.
  78. #
  79. #        The F class contains all known names for the host defined
  80. #        in the F macro.
  81. #
  82. #        Mail will only sent to the forwarder as a last resort in
  83. #        the event that:
  84. #
  85. #            a) this host cannot canonicalize the destination
  86. #               hostname or determine an appropriate relay or mail
  87. #               exchanger to deal with it.
  88. #
  89. #            - or -
  90. #
  91. #            b) the appropriate host or relay or exchanger
  92. #               to which this host will be sending the message
  93. #               turns out to exist outside of the top level
  94. #               domain (see the T macro below).
  95. #
  96. #        If no such host exists, the F macro and class should be
  97. #        left empty.  If this host is the forwarder host, the F macro
  98. #        should contain this host's full hostname while the F class
  99. #        should contain all known names for this host.
  100. #
  101. #        In the event that this host is the forwarder host and one
  102. #        of the above conditions for sending mail on to the forwarder
  103. #        host is met, this host will put messages to unknown hosts or
  104. #        domains out "on the wire" and hope for the best.
  105. #
  106. #    T macro ((T)op level domain)
  107. #        This macro defines the name of the top level of the local
  108. #        domain space.  For example, if this host resides in
  109. #        some subdomain BAR.FOO.COM under the FOO.COM domain, and
  110. #        if all hosts under the FOO.COM domain or any subdomain
  111. #        under the FOO.COM domain are to be considered internal
  112. #        hosts, you would define the T macro to be FOO.COM.
  113. #
  114. #        The top level domain is used in conjunction with the
  115. #        definition of the forwarder host defined in the F macro
  116. #        and class above.  All mail destined to hosts "outside" the
  117. #        top level domain will be sent via the forwarder host.
  118. #
  119. #    K class ((K)illed hosts in the local domain)
  120. #        This class is a list of all known "killed" or "dead" hosts
  121. #        in the local domain.  This list is generally used by relay
  122. #        or exchanger machines to detect mail to no-longer-existent
  123. #        hosts.  Mail to such hosts will be redirected to the
  124. #        forwarder machine (defined in the F macro above).
  125. #
  126. #    P macro ((P)athalias database)
  127. #        This macro defines the location of the pathalias database.
  128.  
  129.  
  130. #####################################
  131. # Parameters which MUST be defined. #
  132. #####################################
  133.  
  134. #### D macro and class #####################################################
  135. # D macro: Our full local domain name.
  136. # If domains are not used, delete or comment out this line.
  137. DD|/usr/etc/configmail get localdomain
  138.  
  139. # D class: Domains into which we should send mail directly.
  140. # Explicit list of all domains into which we can and should send mail
  141. # directly (without the use of any forwarder, relay, or exchanger hosts.)
  142. # If this host is a relay or exchanger for a particular domain, that domain
  143. # should be listed here, otherwise this class may be left empty.
  144. FD|/usr/etc/configmail get directdomains
  145.  
  146. #### F macro and class #####################################################
  147. # F macro: Forwarder hostname.
  148. # The F macro must contain the name of the forwarder host.
  149. # If no such host exists this macro should be empty.  If this host is the
  150. # forwarder, this macro should be defined to contain this host's name.
  151. DF|/usr/etc/configmail get forwarder
  152.  
  153. # F class: Alternate forwarder hostnames.
  154. # The F class should contain all known hostnames for the forwarder host
  155. # defined above.  If the F macro is empty, the F class should be empty as
  156. # well.
  157. FF|/usr/etc/configmail get forwarder
  158. FF|/usr/etc/configmail get forwarder -s
  159.  
  160. #### T macro and class #####################################################
  161. # T macro: Our top-level domain name.
  162. # Defines the top level of our local domain space.  Mail to any machines
  163. # which exist in this domain or any sub-domain under this domain will be
  164. # considered local or internal (as opposed to foreign).  It will be
  165. # considered O.K. to query for relay hosts in this domain or any sub-domain
  166. # under this domain.
  167. #
  168. # Mail to any machine which does not exist in this domain or any sub-domain
  169. # under this domain will be sent to the forwarder host (defined above) for
  170. # further disposition.
  171. #
  172. # If you do not use domain addressing, this macro should be left blank.
  173. DT|/usr/etc/configmail get rootdomain
  174.  
  175.  
  176. ############################################
  177. # Parameters which MAY need to be defined. #
  178. ############################################
  179.  
  180. #### K class ###############################################################
  181. # Killed machines within the local domain:  These machines have been
  182. # permanently turned off.  All mail for them should be redirected to the
  183. # forwarder.  This class is used by domain forwarders to redirect mail
  184. # to known bad, dead, renamed, etc. hosts.  This class only needs to be
  185. # defined on domain forwarders.
  186. #
  187. # Note that this class can be defined inline via the CK command and/or
  188. # may be read from the sendmail.killed file.
  189. FK|/usr/etc/configmail get deadhosts
  190.  
  191. # Additionally for the K class...
  192. # Many machines generate UUCP return paths which include '!somewhere!' 
  193. # when they get confused.  It is a good idea to make sure that your
  194. # K class contains at least 'somewhere'.
  195. CKsomewhere
  196.  
  197. #### P macro ###############################################################
  198. # Look here for path-alias database.
  199. DP|/usr/etc/configmail get pathalias
  200.  
  201.  
  202. #############################################################
  203. # Other Parameters which come pre-configured and SHOULD NOT #
  204. # need to be redefined.                                     #
  205. #############################################################
  206.  
  207. # Official hostname
  208. Dj$w
  209.  
  210. # R macro: Relay hostname.
  211. # This macro defines the hostname (or an alias) used by
  212. # all hosts which act as relay machines.  Relay machines
  213. # are "forwarders" to known internal domains and are themselves
  214. # defined by the use of this relay hostname as their hostname
  215. # or alias.
  216. #
  217. # This macro comes pre-configured as "relay" which is strongly
  218. # suggested.
  219. #
  220. # This macro must not be left blank although it is not necessary
  221. # for any actual relay machines to be configured in the
  222. # network.
  223. #
  224. # Mail relay hosts implement a sort of "poor man's" MX scheme.
  225. # They may also be useful as an emergency "back-up" to the use
  226. # of MX records.
  227. DR|/usr/etc/configmail get relayname
  228.  
  229. # T class: Our top-level domain name.
  230. # Must be identical to the definition of the T macro above or all hell
  231. # will break loose.  Defined via the T macro, do not touch!
  232. CT $T
  233.  
  234. # V class: UUCP machines
  235. # This class is the list of all machines to which we can send mail
  236. # via UUCP
  237. FV/usr/lib/uucp/Systems %[-_a-zA-Z0-9]
  238.  
  239. # N class: UUCP machines that understand domains
  240. # This class is the list of all machines to which we can send mail
  241. # via UUCP and which understand domain-style addressing.  We don't
  242. # need to rewrite addresses into uucp-style when mailing to these
  243. # machines.
  244. FN/usr/lib/uucp/Systems #domain-machine %s
  245.  
  246.  
  247. ######################
  248. ### Version Number ###
  249. ######################
  250.  
  251. DZ911001.SGI
  252.  
  253. ###########################
  254. ## Used for lookup logic ##
  255. ###########################
  256.  
  257. DYFAIL
  258. CY $Y
  259.  
  260. ##########################
  261. ##### Special macros #####
  262. ##########################
  263.  
  264. # my name
  265. DnMAILER-DAEMON
  266.  
  267. # UNIX header format
  268. DlFrom $g  $d
  269.  
  270. # delimiter (operator) characters
  271. Do.:%@!^=/[]
  272.  
  273. # format of a total name
  274. Dq$g$?x ($x)$.
  275.  
  276. # SMTP login message
  277. De$j Sendmail $v/$Z ready at $b
  278.  
  279.  
  280. ###################
  281. ###   Options   ###
  282. ###################
  283.  
  284. # location of local alias file
  285. OA/usr/lib/aliases
  286.  
  287. # wait up to x (originally ten) minutes for alias file rebuild
  288. Oa9
  289.  
  290. # substitution for space (blank) characters
  291. OB.
  292.  
  293. # (don't) connect to "expensive" mailers
  294. #Oc
  295.  
  296. # default delivery mode (deliver in background)
  297. Odbackground
  298. #Odqueue
  299.  
  300. # temporary file mode
  301. OF0600
  302.  
  303. # default UID
  304. Ou998
  305.  
  306. # default GID
  307. Og998
  308.  
  309. # location of help file
  310. OH/usr/lib/sendmail.hf
  311.  
  312. # log level;  1 is usually right--9 is nice for debugging
  313. OL3
  314.  
  315. # default network name
  316. ON$D
  317.  
  318. # default messages to old style
  319. Oo
  320. # queue directory
  321. OQ/usr/spool/mqueue
  322. # read timeout -- violates protocols
  323. Or2h
  324. # status file
  325. OS/usr/lib/sendmail.st
  326. # queue up everything before starting transmission
  327. Os
  328. # default timeout interval
  329. OT7d
  330. # time zone names (V6 only)
  331. # wizard's password
  332. OW*
  333. # load average at which we just queue messages
  334. Ox20
  335. # load average at which we refuse connections
  336. OX25
  337. # rebuild alias file
  338. OD
  339.  
  340. # ??? unusual rule
  341. # Define NIS mail.byaddr (reverse alias) file.
  342. # Also see ruleset 11 below for use of this database.
  343. #OKA%mail.byaddr
  344.  
  345. ###############################
  346. ###   Message precedences   ###
  347. ###############################
  348.  
  349. Pfirst-class=0
  350. Pspecial-delivery=100
  351. Pbulk=-60
  352. Pjunk=-100
  353.  
  354. #########################
  355. ###   Trusted users   ###
  356. #########################
  357.  
  358. Troot
  359. Tdaemon
  360. Tuucp
  361. Tuucpadm
  362.  
  363. #############################
  364. ###   Format of headers   ###
  365. #############################
  366.  
  367. HReceived: $?sfrom $s $.by $j $?rvia $r $.($v/$Z)
  368.     $?ufor $u$. id $i; $b
  369. H?P?Return-Path: <$g>
  370. H?D?Resent-Date: $a
  371. H?D?Date: $a
  372. H?F?Resent-From: $q
  373. H?F?From: $q
  374. H?x?Full-Name: $x
  375. HSubject:
  376. # HPosted-Date: $a
  377. # H?l?Received-Date: $b
  378. H?M?Resent-Message-Id: <$t.$i@$j>
  379. H?M?Message-Id: <$t.$i@$j>
  380. # H?R?Return-Receipt-To: $g
  381.  
  382.  
  383. ###########################
  384. ###   Rewriting rules   ###
  385. ###########################
  386.  
  387.  
  388. #############################################################
  389. # insert this handy debugging line wherever you have problems
  390. #R$*                $:$>99$1
  391.  
  392. ######################################
  393. #  Debugging ruleset - Leave empty.  #
  394. ######################################
  395. S99
  396.  
  397. ################################
  398. #  Sender Field Pre-rewriting  #
  399. ################################
  400. S1
  401.  
  402. ###################################
  403. #  Recipient Field Pre-rewriting  #
  404. ###################################
  405. S2
  406.  
  407. #################################
  408. #  Final Output Post-rewriting  #
  409. #################################
  410. S4
  411.  
  412. R@            $@                handle <> error addr
  413.  
  414. # convert mixed UUCP and domains into UUCP
  415. #    but only in some simple cases where it is not wrong
  416. R$+!$+<@$*>        $:$>5$1!$2<@$3>
  417.  
  418. R$*<$+>$*        $1$2$3                defocus
  419. R@$+:@$+:$+        @$1,@$2:$3            <route-addr> canonical
  420.  
  421.  
  422.  
  423. ###########################
  424. #  Name Canonicalization  #
  425. ###########################
  426. S3
  427.  
  428. # handle "from:<>" special case
  429. R<>            $@@                turn into magic token
  430.  
  431. # basic textual canonicalization -- note RFC733 heuristic here
  432. R$*<$*<$*<$+>$*>$*>$*    $4                3-level <> nesting
  433. R$*<$*<$+>$*>$*        $3                2-level <> nesting
  434. R$*<$+>$*        $2                basic RFC821/822 parsing
  435. #R$+ at $+        $1@$2                "at"->"@" for RFC 822
  436.  
  437. R$j!$+            $1                strip our host name
  438. R$=w!$+            $2                even if it has dots
  439. R$=w.$D!$+        $2
  440.  
  441. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  442. R@$+,@$+        @$1:@$2                change all "," to ":"
  443.  
  444. # localize and dispose of route-based addresses
  445. R@$+:$+            $@<@$1>:$2            handle <route-addr>
  446.  
  447. # more miscellaneous cleanup
  448. R$+:$*;@$+        $@$1:$2;@$3            list syntax
  449. R$+:$*;            $@$1:$2;            list syntax
  450. R$*@$+            $:$1<@$2>            focus on domain
  451. R$*<$+@$+>        $1$2<@$3>            move gaze right
  452. R$*<@$+>        $@$1<@$2>            already canonical
  453.  
  454. # convert old-style addresses to a domain-based address
  455. R$-:$+            $@$2<@$1>            host:user
  456. R$+^$+            $1!$2                convert ^ to !
  457. R$-.$+!$+        $@$3<@$1.$2>            host.domain!user
  458. R$-!$+            $@$2<@$1>            host!user (uucp)
  459. R$+%$+            $:$1<@$2>            user%host
  460. R$+<@$+%$+>        $1%$2<@$3>            move gaze right
  461. R$*<@$+>        $@$1<@$2>            now % is canonical
  462. R$-=$+            $@$2<@$1.BITNET>        host=user (bitnet)
  463. #R$-.$+            $@$2<@$1>            host.user (? XXX ?)
  464.  
  465.  
  466.  
  467. #########################
  468. # retry rule for rule 0 #
  469. #########################
  470. # This is used to avoid having to always invoke rule 3 at the start of
  471. #    rule 0, as standard configurations do.  It is invoked to re-start
  472. #    parsing.
  473. S29
  474. R:$*            $:$1                remove routing debris
  475. R<@$*>:@$*        <@$1>,@$2
  476.  
  477. R$+!$+            $:$>5$1!$2            make UUCP style pure
  478.  
  479. R$*<$*>$*        $1$2$3                defocus
  480. R$+            $:$>3$1                make canonical
  481. R$+            $@$>0$1                try rule 0 again
  482.  
  483.  
  484.  
  485. ###########################
  486. # general address parsing #
  487. ###########################
  488. S0
  489.  
  490. # Handle some special cases.....
  491. R@            $#local$:$n            handle <> form
  492. R$*<@[$+]>$*        $:$1<@$[[$2]$]>$3        numeric internet spec
  493.  
  494. # Canonicalize the host name.  Detect any failures.
  495. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  496.  
  497. # If we successfully canonicalize a hostname, but the result contains
  498. # no dots, make it relative to our domain.
  499. R$*<@$->$*        $1<@$2.$D>$3
  500. R$*<$*.>$*        $1<$2>$3            drop any trailing dot
  501. R$*<$*..$Y>$*        $1<$2.$Y>$3            tidy any double dot
  502.  
  503. # now delete the local info
  504. R$+            $:$>30$1            detect local info
  505. R$*<@@$*>$*        $@$>29$1$3            remove local and retry
  506.  
  507. R<@>$*            $@$>29$1            route strip & retry
  508. R$*<@>            $@$>29$1            strip null & retry
  509.  
  510. # Hostname is now non-local and as canonical as we are going to get.
  511. # If the initial canonicalization step failed, ".FAIL" ($Y) has been
  512. # appended to the hostname.
  513.  
  514. # If the mail is destined for a known dead host, strip that host and
  515. # retry.
  516. R$*<@$=K>$*        $@$>29$1$3
  517. R$*<@$=K.$Y>$*        $@$>29$1$3            even on failures
  518.  
  519. # If the mail is destined for a host in a domain for which we are
  520. # responsible, send it directly.
  521. R$*<@$-.$=D>$*        $#ether$@$2.$3$:$1<@$2.$3>$4
  522.  
  523. # The above is true even if we failed to canonicalize.  We are supposed
  524. # to know how to deal with the message.  If we can't, who can?
  525. R$*<@$-.$=D.$Y>$*    $#ether$@$2.$3$:$1<@$2.$3>$4
  526.  
  527. # If the mail is destined for the forwarder, send it directly.
  528. R$*<@$=F>$*        $#ether$@$2$:$1<@$2>$3
  529.  
  530. # See if an MX record is available for the resulting hostname.
  531. R$*<@$+$~Y>$*        ${@$2$3$:$Y$}^$1^$2$3^$4
  532.  
  533. # Do the MX lookup even on failures since some host may choose to
  534. # advertise itself as an exchanger for some otherwise uncanonicalizable
  535. # hostname.
  536. R$*<@$+.$Y>$*        ${@$2$:$Y$}^$1^$2.$Y^$3
  537.  
  538. # If we fail to find any MX record and the address is of the form:
  539. # user@domain.for.which.we.are.responsible, strip and retry.
  540. R$Y$*^$*^$=D^$*        $@$>29$2$4
  541. R$Y$*^$*^$=D.$Y^$*    $@$>29$2$4
  542.  
  543. # See if we have to use a forwarder to mail to the exchanger.
  544. R$~Y$*^$*        $:$>31@@<@$1$2>^$3        found one!
  545. R@@<@@@$+>$*        $:@@@@$2            use the forwarder
  546. R@@<@@$+>$*        $:@@@$2                we are forwarder
  547.  
  548. # Use the appropriate mailer.
  549. R@@@@$*^$*^$*.$Y^$*    $@$>29@$F:$2@$3$4        use forwarder
  550. R@@@@$*^$*^$*^$*    $@$>29@$F:$2@$3$4
  551.  
  552. R@@@$*^$*^$*.$Y^$*    $#forgn$@$3$:$2<@$3>$4        exchanger is external
  553. R@@@$*^$*^$*^$*        $#forgn$@$3$:$2<@$3>$4
  554.  
  555. R@@$*^$*^$*.$Y^$*    $#ether$@$3$:$2<@$3>$4        exchanger is internal
  556. R@@$*^$*^$*^$*        $#ether$@$3$:$2<@$3>$4
  557.  
  558. R$Y^$*^$*^$*        $1<@$2>$3            no (or bad) MX, tidy
  559.  
  560. # If we successfully canonicalized the hostname, but couldn't find any good
  561. # MX record to tell us what to do with the message, see if we should send the
  562. # message on to a forwarder.
  563. R$*<@$*$~Y>$*        $:$>31^$1<@$2$3>$4        mark if canonical
  564. R^$*<@@@$*>$*        $@$>29@$F:$1@$2$3        send to forwarder
  565. R^$*<@@$*>$*        $#forgn$@$2$:$1<@$2>$3        we are forwarder
  566. R^$*            $:$1                unmark
  567.  
  568. # ??? unusual rule
  569. # Notice news stuffing, and stuff mail for newsgroups into a suitable script
  570. #R$*<@news-stuff.$D>    $#mailnews$:$1
  571. #R$*<@news-stuff.$D.$Y>    $#mailnews$:$1
  572.  
  573. # The message is now either to an uncanonicalizable host, or an internal
  574. # host for which no MX record exists.
  575.  
  576. # For internal hosts, see if there's an appropriate relay
  577. # machine (poor man's MX).
  578.  
  579. # If within our domain space, try "relay".addressee.domain
  580. # (even if we failed to canonicalize)
  581.  
  582. R$*<@$*$=T>$*        $:^<@$[$R.$2$T$:$Y.$2$T$]>$1^$2$T^$4
  583. R$*<@$*$=T.$Y>$*    $:^<@$[$R.$2$T$:$Y.$2$T.$Y$]>$1^$2$T.$Y^$4
  584. R^<@$Y.$-.$*$=T>$*    $:^<@$[$R.$2$T$:$Y.$1.$2$T$]>$4
  585. R^<@$Y.$-.$*$=T.$Y>$*    $:^<@$[$R.$2$T$:$Y.$1.$2$T.$Y$]>$4
  586.  
  587. R^<@$~Y$*>$*^$*^$*    $:$>30<@$1$2>$3^$4^$5
  588. R^<@$Y.$*>$*^$*^$*    $:$2<@$3>$4
  589.  
  590. R<@@$*>$*        $:<@$Y@>$2            check for self
  591.  
  592. R<@$~Y$*>$*^$*.$Y^$*    $#ether$@$1$2$:$3<@$4>$5    strip any .FAIL & bye!
  593. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  594.  
  595. R<$*>$*^$*^$*        $:$2<@$3>$4            tidy
  596.  
  597. # No appropriate relay (or relay is us). If we successfully
  598. # canonicalized and the resulting hostname is in or under our
  599. # domain, just send it directly.
  600.  
  601. R$*<@$*.$Y>$*        $:$Y^$1<@$2>$3
  602. R$~Y$*<@$*.$D>$*    $#ether$@$3.$D$:$1$2<@$3.$D>$4    bye bye
  603.  
  604. # Since we have determined that we may be the relay for the addressee domain,
  605. # see if the addressee host is actually some uncanonicalizable nickname
  606. # for ourselves (canonicalizable nicknames would have been stripped as local
  607. # info at the top of this ruleset).  If so, strip and retry.
  608.  
  609. R$Y^$*            $:$>30$1
  610. R$*<@@$*>$*        $@$>29$1$3
  611.  
  612. # All notion of "uncanonicalized" is now stripped (.FAIL removed from
  613. # addressee hostname).  See if our "uncanonicalizable" host can be found
  614. # in the UUCP maps or if a hard-coded exchanger exists.
  615.  
  616. # From UUCP host to UUCP host
  617. #    "goo.UUCP" is the "goo" in the UUCP maps, which may not be the same
  618. #    as "goo.UUX" which is the goo to which we talk directly.
  619. R$*<@$=V.$D>$*        $:@@$1<@$2.$D>$3
  620. R$*<@$=V.UUX>$*        $:@@$1<@$2.UUX>$3
  621. R$*<@$=V>$*        $:@@$1<@$2.UUX>$3
  622.  
  623. R@@$*<@$*$=N.UUX>$*    $#dom$@$3$:$1<@$2$3>$4
  624. R@@$*<@$*$=N.$+>$*    $#dom$@$3$:$1<@$2$3.$4>$5
  625. R@@$*<@$-.$+>$*        $#uucp$@$2$:$1<@$2>$4
  626.  
  627. #re-alias for dead hosts
  628. R$*<@$=K>$*        $@$>29$1$3
  629.  
  630. # ??? unusual rule
  631. # Talk to Internet forwarders.  In the absence of MX record handling
  632. #    this set of rules implement a useful kludge.  Of course, ...
  633. #R$*<@$*fozul.com>$*    $#forgn$@fozul.com$:$1<@$2fozul.com>$3
  634.  
  635.  
  636. # look for a UUCP/pathalias path to a host
  637. #    "goo.UUCP" is the "goo" in the UUCP maps, which may not be the same
  638. #    as "goo.UUX" which is the goo to which we talk directly.
  639. # ??? unusual rule
  640. #    It is not usually a good idea to send all host names through the maps.
  641. #    IMPORTANT, un-comment at most 1 of the following lines.
  642. R$+<@$->            $:^$1<@$[!$P!$2$]><@$2>
  643. #R$+!$+<@$->            $:^$1!$2<@$[!$P!$3$]><@$3>
  644. #
  645. R$+<@$-.UUCP>            $:^$1<@$[!$P!$2$]><@$2.UUCP>
  646.  
  647. R^$+<@!$P!$=V><@$+>        $@$>29$1@$2
  648. R^$+<@!$P!$-><@$+>        $:$1<@$3>
  649.  
  650. # if UUCP resolution succeeds, start over
  651. R^$+<@$+><@$+>            $@$>29$2!$1
  652.  
  653. # resolve unknown UUCP domains with pathalias
  654. R$+<@$+.UUCP>            $:^$1<@$2><$[!$P!$2$]>
  655. R^$+<@$+><!$P!$*.$D>        $@$>29$1@$2        recognize LOCAL.uucp
  656. R^$+<@$+><!$P!$*>        $:$1<@$2.UUCP>
  657. R^$+<@$+><$*>            $@$>29$3!$2!$1        use generated path
  658.  
  659. # resolve unknown domains with pathalias
  660. R$*<@$+.$+>$*            $:^$1<@$2.$3><$[!$P!$2.$3$]>$4
  661. R^$*<@$+><!$P!$*>$*        $:$1<@$2>$4
  662. R^$*!$*<@$+><$=N>        $@$>29$4!$3!$1!$2    domain to good neighbor
  663. R^$*!$*<@$+><$=N!$+>        $@$>29$4!$3!$1!$2
  664. R^$+<@$+><$=N>            $@$>29@$3:$1@$2
  665. R^$+<@$+><$=N!$+>        $@$>29@$3:$1@$2
  666. R^<@$+><$+!$+>$+        $@$>29@$2:@$1$4        use generated path
  667. R^<@$+><$+>$+            $@$>29@$2:@$1$3
  668. R^$+<@$+><$+>            $@$>29$3!$2!$1
  669. # we cannot convert nasty stuff--where do the !'s go?
  670. R^$*<@$+><$*>$*            $:$1<@$2>$4
  671.  
  672. # O.K.  I give up!  Send this message to someone wiser.
  673.  
  674. # See if we need to use a forwarder.
  675. R$*<@$*>$*        $:$>31$1<@$2>$3
  676. R$*<@@@$*>$*        $@$>29@$F:$1@$2$3        send to forwarder
  677. R$*<@@$*>$*        $#forgn$@$2$:$1<@$2>$3        we are forwarder
  678.  
  679. # Destination is internal.  Try "relay".our.domain
  680. R$*<@$*>$*        $:$>30<@$[$R.$D$:$Y$]>$1^$2^$3
  681. R<@@$*>$*        $:<@$Y@>$2            check for self
  682. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  683. R<$*>$*^$*^$*        $:$2<@$3>$4            tidy
  684.  
  685. # Message is rated PG (Parental Guidance suggested)...
  686. # First, determine our domain's location relative to the top level.
  687. R$*<@$*>$*        $:$D^$1^$2^$3
  688. R$*$=T^$*        $:$1^$3
  689. R$*.^$*            $:$1^$2
  690.  
  691. # If our domain isn't the top domain, try and send this message
  692. # to "relay".our.parent.domain
  693. R$+.$+^$*        $:$>30<@$[$R.$2$T$:$Y$]>$1.$2^$3
  694. R<@@$*>$*        $:<@$Y@>$2            check for self
  695. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  696. R<$*>$*^$*        $:$2^$3
  697. R$+^$*            $:$>30<@$[$R.$T$:$Y$]>$1^$2
  698. R<@@$*>$*        $:<@$Y@>$2            check for self
  699. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  700. R<$*>$*^$*        $:$2^$3
  701.  
  702. # If the top domain isn't our domain, or our immediate parent domain,
  703. # try and send this message to "relay".top.domain
  704. R$+.$+^$*        $:$>30<@$[$R.$T$:$Y$]>$1.$2^$3
  705. R<@@$*>$*        $:<@$Y@>$2            check for self
  706. R<@$~Y$*>$*^$*^$*^$*    $#ether$@$1$2$:$4<@$5>$6    bye bye!
  707.  
  708. # Try just "relay"
  709. R<$*>$*            $:$2
  710. R$*^$*^$*^$*        $:$2^$3^$4
  711. R$*^$*^$*        $:$>30<@$[$R$:$Y$]>$1^$2^$3
  712. R<@$~Y$*>$*^$*^$*    $#ether$@$1$2$:$3<@$4>$5    bye bye!
  713. R<$*>$*^$*^$*        $:$2<@$3>$4
  714. R^$*^$*^$*        $:$1<@$2>$3
  715.  
  716. # Send completely unknown stuff to the forwarder.
  717. R$*<@$*>$*        $:$>30<@$F>$1^$2^$3
  718. R<@@$*>$*        $:<@$Y@>$2            check for self
  719. R<@$~Y$*>$*^$*^$*    $@$>29@$F:$3@$4$5        bye bye!
  720. R<$*>$*^$*^$*        $:$1<@$2>$3
  721.  
  722. # Drat!  Not much else we can do! 
  723. # Complain about unknown machines and domains
  724. R$*<@$*>$*        $#ether$@$2$:$1<@$2>$3        BOING!?!?
  725.  
  726. # everything else must be a local name or alias
  727. R$*            $#local$:$1
  728.  
  729. ################################
  730. # convert to UUCP style routes #
  731. ################################
  732. S5
  733. R$*<$+>$*        $1$2$3            defocus
  734. R@$+:@$+:$+        @$1,@$2:$3        <route-addr> canonical
  735. R@$+,@$+        @$1!$2            @a,@b:user@c to @a!b:user@c
  736. R@$+:$+@$+        $:$1!$3!$2        @a!b:user@c to a!b!c!user
  737. R$+@$+            $2!$1            simple domain address
  738.  
  739. R$-.UUCP!$+        $1!$2
  740. R$-.UUX!$+        $1!$2
  741.  
  742.  
  743. ########################
  744. # strip internal paths #
  745. ########################
  746. S7
  747. R$*            $:$>5$1                convert to UUCP style
  748.  
  749. # remove our name for mailers which will add our hostname in any case
  750. R$=w!$+            $@$>7$2
  751. R$j!$+            $@$>7$1
  752.  
  753.  
  754. ##################################
  755. # resolve unknown UUCP addresses #
  756. ##################################
  757. S8
  758. R$*<@$*$D>$*            $@$1<@$2$D>$3        recognize our domain
  759. R$*<@$=w.UUCP>$*        $@$1<@$2.UUCP>$3
  760.  
  761. R$*<@$=V.UUCP>$*        $@$1<@$2.UUCP>$3    notice our modems
  762.  
  763. R$*                $:$w!$1            prepend "ourself!"
  764. R$~F!$*                $@$2            quit if not a forwarder
  765. R$~F.$+!$*            $@$3
  766. R$+!$*                $:$2
  767.  
  768. # look for a path to a host
  769. R$*<@$-.UUCP>            $:!!$1<@$[!$P!$2$]>
  770. R!!$*<@!$P!$->            $@$1<@$2.UUCP>
  771. R!!$*<@$*>            $@$2!$1            use generated path
  772.  
  773. # resolve unknown UUCP domains
  774. R$*<@$+.UUCP>            $:!!$1<@$2><$[!$P!$2$]>
  775. R!!$*<@$+><!$P!$+>        $@$1<@$2.UUCP>
  776. R!!$*<@$+><$+>            $@$3!$2!$1        use generated path
  777.  
  778. # resolve unknown domains
  779. R$*<@$+.$+>            $:!!$1<@$2.$3><$[!$P!$2.$3$]>
  780. R!!$*<@$+><!$P!$*>        $@$1<@$2>
  781. R!!<@$+><$+>            $@$2!$1
  782. R!!$+<@$+><$+>            $@$3!$2!$1
  783.  
  784.  
  785. ############################################################
  786. ############################################################
  787. #    Useful utilities
  788. ############################################################
  789. ############################################################
  790.  
  791. # S30 - Detect our hostname
  792. # If the hostname in focus is us, mark it by doubling the "@"
  793. # if so.
  794. S30
  795. # Find other names for ourself.
  796. #    XXX this should be handled in the $=w macro
  797. #R$*<@alternatename.foo.com>$*    $@$1<@@$j>$2
  798.  
  799. R$*<@>$*        $@$1<@@>$2            null host is thishost
  800. R$*<@$=w>$*        $@$1<@@$2>$3            thishost
  801. R$*<@$j>$*        $@$1<@@$j>$3            even if it has dots
  802.  
  803. # ??? - unusual rule
  804. # Uncomment the following lines if you don't have a wildcard MX record for
  805. # the LOCAL domain and if you want to treat foo@LOCAL as foo@THISHOST.
  806. #R$*<@$D>$*        $@$1<@@$D>$2            LOCAL
  807. #R$*<@.$D>$*        $@$1<@@.$D>$2            .LOCAL
  808.  
  809. R$*<@$=w.UUCP>$*    $@$1<@@$2.UUCP>$3        thishost.UUCP
  810. R$*<@$j.UUCP>$*        $@$1<@@$j.UUCP>$2
  811.  
  812. # S31 - See if we should use the forwarder
  813. # Return with the "@" in front of the focused host modified as follows:
  814. #    unchanged - host is internal, use of forwarder should be unnecessary.
  815. #    @ -> @@   - host is external and we are the forwarder or forwarder
  816. #            loop detected.
  817. #    @ -> @@@  - host is external and we are not the forwarder.
  818. S31
  819. R$*<@$*$=T>$*        $@$1<@$2$T>$4            not external
  820. R$*            $:$>30<@$F>$1
  821. R<@@$*>$*<@$*>$*    $@$2<@@$3>$4            we're the forwarder
  822. R<@$*>$*<@$=F>$*    $@$2<@@$3>$4            forwarder loop, send!
  823. R<@$*>$*<@$*>$*        $@$2<@@@$3>$4            send to forwarder!
  824.  
  825. ############################################################
  826. ############################################################
  827. #####
  828. #####        Local and Program Mailer specification
  829. #####
  830. ############################################################
  831. ############################################################
  832.  
  833. Mlocal, P=/bin/mail, F=EDFMlsmhu, S=10, R=20, A=mail -s -d $u
  834. Mprog,    P=/bin/sh,   F=lsDFMe, S=10, R=20, A=sh -c $u
  835.  
  836. S10
  837. R$+!$+            $:$>7$1!$2            clean UUCP style
  838. R$*<@$j>        $@$1
  839. R$*<@$=w>        $@$1
  840. R$*<@$=w.$D>        $@$1
  841. R$*<@$-.$D>        $1<@$2>
  842.  
  843. S20
  844. R$+!$+            $:$>7$1!$2            clean UUCP style
  845. R$*<@$j>        $@$1
  846. R$*<@$=w>        $@$1
  847. R$*<@$=w.$D>        $@$1
  848. R$*<@$-.$D>        $1<@$2>
  849. R$*<@>            $@$1
  850.  
  851.  
  852. ############################################################
  853. ############################################################
  854. #####
  855. #####        Ethernet Mailer specification
  856. #####
  857. ############################################################
  858. ############################################################
  859.  
  860. Mether,    P=[IPC], F=mDFMhuXC, S=11, R=21, E=\r\n, A=IPC $h
  861.  
  862. S11
  863. # Canonicalize any hostname.  Mark failures.
  864. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  865.  
  866. # If successfully canonicalize to single-token hostname, make relative
  867. # to our local domain.
  868. R$*<@$->$*        $:$1<@$2.$D>$3
  869.  
  870. # Tidy up a bit.
  871. R$*<@$+.$Y>$*        $:$1<@$2>$3        strip any .FAIL
  872. R$*<@$+.>$*        $1<@$2>$3        strip any trailing dot(s)
  873.  
  874. # ??? unusual rule
  875. # Try and match the whole gory thing in the reverse aliases map.
  876. # Also see OKA database definition above.
  877. #R$*            $:^$1
  878. #R^$*<@$*>$*        $:$(A$1@$2$3$:$1<@$2>$3$)
  879. #R^$+            $:$(A$1$:$1$)
  880.  
  881. R$+!$+            $:$>7$1!$2        clean UUCP style
  882. R$-<@$=V>        $2!$1            convert UUCP neighbors
  883. R$+!$+            $:$w!$1!$2        tack on our hostname
  884. R$+!$+            $@$>5$1!$2
  885. R$*<@$+>$*        $@$1<@$2>$3
  886. R$+            $@$1<@$j>
  887.  
  888. S21
  889. R$+!$+            $@$>5$1!$2        make UUCP style pure
  890. R$+<@[$+]>        $@$1<@[$2]>        pass IP numbers
  891.  
  892. # Canonicalize any hostname.  Mark failures.
  893. R$*<@$+>$*        $:$1<@$[$2$:$2.$Y$]>$3
  894.  
  895. # If successfully canonicalize to single-token hostname, make relative
  896. # to our local domain.
  897. R$*<@$->$*        $:$1<@$2.$D>$3
  898.  
  899. # Tidy up a bit.
  900. R$*<@$+.$Y>$*        $:$1<@$2>$3        strip any .FAIL
  901. R$*<@$+.>$*        $1<@$2>$3        strip any trailing dot(s)
  902.  
  903. R$-<@$=V>        $@$>5$1<@$2>        convert UUCP short hand
  904. R$-            $:$1<@$j>
  905.  
  906.  
  907. ############################################################
  908. ############################################################
  909. #####
  910. #####        UUCP Mailer specifications
  911. #####
  912. ############################################################
  913. ############################################################
  914.  
  915.  
  916. # Domain UUCP, which can take >1 destination per transaction, and understands
  917. #    domains.  These guys like 'remote from' lines, unlike ethernet users.
  918. Mdom, P=/usr/bin/uux, F=sDFMhumUC, S=13, R=23, A=uux - $h!rmail ($u)
  919.  
  920. S13
  921. R$*<@$-.UUCP>        $:$>7$1<@$2.UUCP>
  922. R$*            $:$>11$1
  923. R$-.$D!$+        $1!$2            remove our domain if UUCP
  924.  
  925. S23
  926. R<@$+>$+        $:$>5<@$1>$2        822 route to UUCP route
  927. R$*<@$-.UUCP>        $:$>5$1<@$2.UUCP>
  928. R$*<@$-.UUX>        $:$>5$1<@$2.UUCP>
  929. R$*            $@$>21$1
  930.  
  931.  
  932. # dumb UUCP to the great, outside world
  933. #    Notice we assume they can handle >1 addressee / msg
  934. Muucp, P=/usr/bin/uux, F=sDFMhumUC, S=14, R=24, A=uux - $h!rmail ($u)
  935.  
  936. S14
  937. R$*            $:$>7$1            convert to UUCP style
  938. R$*            $:$w!$1            add gateway name
  939. R$-.$D!$+        $1!$2            remove our domain
  940.  
  941. S24
  942. R$+            $:$>8$1            resolve uucp hosts
  943. R$*            $:$>5$1            convert to UUCP style
  944.  
  945.  
  946.  
  947. ############################################################
  948. ############################################################
  949. #####
  950. #####        Usenet 'Mailer' specification
  951. #####
  952. ############################################################
  953. ############################################################
  954.  
  955. # ??? unusual rule
  956. # stuff news articles into local news groups
  957. Mmailnews, P=/usr/lib/news/mailnews, F=lsDFemC, S=15, R=25, A=mailnews $u
  958.  
  959. S15
  960. R$+!$+            $:$>7$1!$2            clean UUCP style
  961.  
  962. S25
  963. R$+!$+            $:$>7$1!$2            clean UUCP style
  964.  
  965.  
  966.  
  967. ############################################################
  968. ############################################################
  969. #####
  970. #####        Foreign TCP/SMTP Mailer specification
  971. #####
  972. ############################################################
  973. ############################################################
  974.  
  975. # This is the same as the local ethernet mailer.
  976. Mforgn,    P=[IPC], F=mDFMhuXC, S=16, R=21, E=\r\n, A=IPC $h
  977.  
  978. S16
  979. R$*            $:$>11$1    same as normal ethernet
  980.  
  981. # ??? unusual rule
  982. # Rewrite From: lines to hide internal domains (the infamous "%-hack".)
  983. #R$-<@$j>        $@$1<@$j>
  984. #R$-<@$+.$D>        $@$1%$2.$D<@$j>
  985. #R$-<@$+.$D>        $@$1%$2<@$D>
  986.  
  987.  
  988. #S26
  989. #R$*            $@$>21$1    same as normal ethernet
  990.  
  991.